using System;

namespace SDET.Util
{
    public class wc
    {
        public static void Main(string[] args)
        {
            int counter = 0;
            string line;

            if(args.Length > 0 && System.IO.File.Exists(args[0]))
            {
                System.IO.StreamReader file =  new System.IO.StreamReader(args[0]);
                while((line = file.ReadLine()) != null)
                {
                   counter += line.Split(' ').Length;
                }
                file.Close();
                System.Console.WriteLine("# of words: {0}", counter);
            }
        }
    }
}